<?php
require_once("classes/ShopDB.php");
?>
<?php
if (isset($_GET['x'])) {
    $x = (int) $_GET['x'];
} else {
    $x = 0;
}
if (isset($_GET['y'])) {
    $y = $_GET['y'];
} else {
    $y = 0;
}
 
if ( ($x> 0) && (strlen($y) == 32)) {
 
    $query = "UPDATE auth SET active=NULL WHERE (user_id='$x' AND active='" . $y . "') LIMIT 1";  
       
    if ($result = ShopDB::query($query) and mysql_affected_rows() == 1) {
        echo "<h3>Your account is now active. You may now log in.</h3>";
    } else {
        echo '<p><font color="red" size="+1">Your account could not be activated. Please re-check the link or contact the system administrator.</font></p>'; 
    }
 
    mysql_close();
 
} else {
 
    echo "<b>Please use the link that has been sent to your email address. </b>";
 
}
?>